/*
Copyright (c) 2010 Andreas Bjerkeholt
License: MIT
http://www.opensource.org/licenses/mit-license.php
*/
#ifndef __graphics_h__
#define __graphics_h__

#ifdef SML
#include "graphics_sml.h"
#elif SDL
#include "graphics_sdl.h"
#endif

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>

#include "global.h"
#include "gamefield.h"
#include "menu.h"

// Only for targets using game specific volume control
#if defined(SML)
#if defined(GEMEI_760P)
#define VOLUME_NMBR_OF_DOTS 20
#elif defined(DINGOO_A320)
#define VOLUME_NMBR_OF_DOTS 15
#endif
#endif

//extern display* gameDisplay;

extern char debugString[];

extern char hudTimeLeft[];
extern char hudLevelNo[];
extern char hudChipsLeft[];
extern char hudPasswordStr[];

extern uint8_t  levelListEntriesVisible;

extern inline uint32_t gfx_color_back(gfx_color inColor);

void drawSplash();
void drawMenu(uint8_t index);
void drawGame();
void drawError(char* errorMsg, char* errorMsg2);
void drawLevelList(uint16_t offset, uint16_t selected);
void drawExitScreen(uint8_t n);
void drawPasswordInput();
void drawVictoryAnimation();
void drawInstructions();
void drawControls();
void drawOptions(uint8_t curOption);
void drawCredits();
void drawHud();
void drawGrid();
void drawTile(uint16_t x, uint16_t y, uint16_t tile);
void drawLevelSplash();
void drawLevelWon();
void drawLevelGameOver();
void drawVolumeIndicator(uint16_t cur, uint16_t max);
void drawMenuSelection(uint16_t x, uint16_t y, uint16_t length);
void drawMenuWindow(uint16_t startX, uint16_t startY, uint16_t height, char* title);
void takeScreenshot(char* filename);

#endif
